import { createRouter, createWebHistory } from 'vue-router';

import HeaderView from '@/views/HeaderView.vue'
import UserList from '@/views/UserList.vue'
import UserEdit from '@/views/UserEdit.vue'

const routes = [
  {
    path: '/',
    redirect: '/list'
  },
  {
    path: '/list',
    components: {
      'header': HeaderView,
      'main': UserList
    },
    name: 'list'
  },
  {
    path: '/edit',
    components: {
      'header': HeaderView,
      'main': UserEdit
    },
    name: 'edit'
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
